package jobworker

import (
	"gitee.com/captials-team/ubdframe/src/domain/configstc"
	"time"
)

// JobParam op操作参数
type JobParam struct {
	OpId string //op唯一标识

	Action       string
	Interval     time.Duration //执行间隔
	Statistical  bool          //是否启用统计
	ExtendParams configstc.CommonExtendParams
}

// ExtendParamByInt 返回extendParam指定k的int类型值
func (op *JobParam) ExtendParamByInt(k string, def ...int) int {
	return op.ExtendParams.ExtendParamByInt(k, def...)
}

// ExtendParamByFloat 返回extendParam指定k的float类型值
func (op *JobParam) ExtendParamByFloat(k string, def ...float64) float64 {
	return op.ExtendParams.ExtendParamByFloat(k, def...)
}

// ExtendParamByBool 返回extendParam指定k的bool类型值
func (op *JobParam) ExtendParamByBool(k string, def ...bool) bool {
	return op.ExtendParams.ExtendParamByBool(k, def...)
}

func (op *JobParam) ExtendParamValue(k string, def ...string) string {
	return op.ExtendParams.ExtendParamValue(k, def...)
}
